#include <iostream>
#include "cdb_to_bdf_convertor.h"
#include "cdb_to_inp_convertor.h"
#include "inp_to_cdb_convertor.h"
#include "inp_to_bdf_convert.h"
#include "bdf_to_inp_convertor.h"
#include "bdf_to_cdb_convert.h"
#include "convertor.h"

Convertor::Convertor() {
}

Convertor::~Convertor() {
}

Convertor* Convertor::create(CaeConvertor::ModelType inputModelType, CaeConvertor::ModelType outputModelType) {
    switch (inputModelType) {
    case CaeConvertor::MT_INP:
        switch (outputModelType) {
        case CaeConvertor::MT_CDB:
            return new InpToCdbConvertor();
        case CaeConvertor::MT_BDF:
	    return new InpToBdfConvertor();
        default:
            return nullptr;
        }
    case CaeConvertor::MT_CDB:
        switch (outputModelType) {
        case CaeConvertor::MT_INP:
            return new CdbToInpConvertor();
        case CaeConvertor::MT_BDF:
            return new CdbToBdfConvertor();
        default:
            return nullptr;
        }
    case CaeConvertor::MT_BDF:
        switch (outputModelType) {
        case CaeConvertor::MT_INP:
           return new BdfToInpConvert();    
        case CaeConvertor::MT_CDB:
	       return new BdfToCdbConvert();
        default:
            return nullptr;
        }
    case CaeConvertor::MT_UNKNOWN:
    default:
        return nullptr;
    }

    return nullptr;
}

